﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebBanHang
{
    public partial class DatHang : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (CurrentContext.IsLogged)
                {
                    string sql = string.Format("select * from DonDatHang where UserName='{0}'", CurrentContext.UserName);
                    gvChiTietDonHang.DataSource = DataProvider.LoadTable(sql);
                    gvChiTietDonHang.DataBind();
                }
                else
                {               
                    Response.Redirect("~/GUI/Login.aspx");                
                }
            }
        }
    }
}